#coding:utf-8
require 'pp'

module API::V3
  class Root < Grape::API
    version 'v3', using: :path
    
    mount API::V3::AuthTokens

    # check every request except AuthTokens and messages
    before do
      unless (Rails.env != 'production') && params[:signature].blank?
        is_authorized?
      end
    end
    
    mount API::V3::Messages
    mount API::V3::Apps
    mount API::V3::Statuses
    mount API::V3::Terminals
    mount API::V3::Users
    mount API::V3::Clients
    mount API::V3::Traffics
    mount API::V3::Blacklists
    mount API::V3::ClientLogs
    mount API::V3::Advertises
    mount API::V3::Wifis
  end
end

